package com.codeOfDoom.Sets.Managers.EffectsManager
{
	import com.codeOfDoom.Sets.SetsCard.SetsCard;
	
	import mx.collections.ArrayCollection;
	import mx.effects.Blur;
	import mx.effects.Glow;
	
	public class EffectsManager
	{
		private static const SELECTEDGLOW:int = 0xFF0000;
		private static const HINTGLOW:int = 0x00FF00;
		private static const BLURCONST:int = 50;
			
		public static function removeAllSelectedGlow(visibleCards:ArrayCollection):void{
			var glow:Glow = new Glow();
    		glow.targets=visibleCards.toArray();
    		glow.duration=1;
    		glow.alphaFrom=.75;
    		glow.alphaTo=0.0;
    		glow.blurXFrom = 20;
    		glow.blurYFrom = 20;
    		glow.blurXTo = 0;
    		glow.blurYTo = 0;
    		glow.play();					    		
		}
		
		public static function addPausedEffect(visibleCards:ArrayCollection):void{
			var blur:Blur = new Blur();
			blur.blurXFrom=0;
			blur.blurYFrom = 0;
			blur.blurXTo = BLURCONST;
			blur.blurYTo = BLURCONST;
			blur.targets = visibleCards.toArray();
			blur.play();
		}
		
		public static function removePausedEffect(visibleCards:ArrayCollection):void{
			var blur:Blur = new Blur();
			blur.blurXFrom=BLURCONST;
			blur.blurYFrom = BLURCONST;
			blur.blurXTo = 0;
			blur.blurYTo = 0;
			blur.targets = visibleCards.toArray();
			blur.play();
		}
		
		public static function addSelectedGlowToCard(setsCard:SetsCard):void{
			var glow:Glow = new Glow();
			
    		glow.color=SELECTEDGLOW;			
    		glow.target=setsCard;    		
			glow.alphaFrom=1.0;
    		glow.alphaTo=.75;
    		glow.blurXTo = 20;
    		glow.blurYTo = 20;
    		glow.play();
		}
		public static function addSelectedGlowToCollectionOfCard(setOfCards:ArrayCollection):void{
			//only used for hints
			var glow:Glow = new Glow();
			glow.color=HINTGLOW;
    		
    		glow.targets=setOfCards.toArray();   		
			glow.alphaFrom=1.0;
    		glow.alphaTo=.75;
    		glow.blurXTo = 20;
    		glow.blurYTo = 20;
    		glow.play();
		}
		public static function removeSelectedGlowToCard(setsCard:SetsCard):void{
			var glow:Glow = new Glow();
			glow.color=SELECTEDGLOW
			
    		glow.target=setsCard;
    		glow.alphaFrom=.75;
    		glow.alphaTo=0.0;
    		glow.blurXFrom = 20;
    		glow.blurYFrom = 20;
    		glow.blurXTo = 0;
    		glow.blurYTo = 0;
    		glow.play();		
		}
	}
}